﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DAL;

namespace BLL
{
    #region class BSubjectInfo
    /// <summary>
    /// Interface:SubjectInfo Interface
    /// Author:NetCenter
    /// DateTime:2021/5/23 15:18:21
    /// </summary>
    public class BSubjectInfo
    {
        DAL.DALSubjectInfo dal = new DAL.DALSubjectInfo();
        #region Add Method
        /// <summary>
        /// Insert an item
        /// </summary>
        /// <param name="SubjectInfo"></param>
        /// <returns>count of rows affected</returns>
        public int AddSubjectInfo(SubjectInfoEntity SubjectInfo)
        {
            return dal.AddSubjectInfo(SubjectInfo);
        }
        #endregion
        #region Mod Method
        /// <summary>
        /// Update an item
        /// </summary>
        /// <param name="SubjectInfo"></param>
        /// <returns>count of rows affected</returns>
        public int ModSubjectInfo(SubjectInfoEntity SubjectInfo)
        {
            return dal.ModSubjectInfo(SubjectInfo);
        }
        #endregion
        #region Del Method
        /// <summary>
        /// Del an item by primary key
        /// </summary>
        /// <param name="subjectNo"></param> 
        /// <returns>count of rows affected</returns>
        public int DelSubjectInfo(int subjectNo)
        {
            return dal.DelSubjectInfo(subjectNo);
        }
        #endregion
        #region Select Method
        /// <summary>
        /// Select an item by Primarykey
        /// </summary>
        /// <param name="subjectNo"></param>
        /// <returns>an item</returns>
        public SubjectInfoEntity GetSubjectInfo(int subjectNo)
        {
            return dal.GetSubjectInfo(subjectNo);
        }
        #endregion
        #region Select_All Method
        /// <summary>
        /// Select all items
        /// </summary>
        /// <returns>items</returns>
        public IList<SubjectInfoEntity> GetSubjectInfos()
        {
            return dal.GetSubjectInfos();
        }
        #endregion
        #region public common select by conditions ,we can use it by changing the GetSubjectInfosbyCondition(datatype condition) and sql
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<SubjectInfoEntity> GetSubjectInfosbyCondition(string sql)
        {
            return dal.GetSubjectInfosbyCondition(sql);
        }
        #endregion
        #region Select items Top n
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<SubjectInfoEntity> GetSubjectInfosTopN(int n)
        {
            return dal.GetSubjectInfosTopN(n);
        }
        #endregion
       
    }
    #endregion
}
